<template>
  <div class="common-layout">
    <el-container>
      <el-container>
        <el-aside width="200px">
          <el-menu
            unique-opened
            default-active="2"
            router
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
          >
            <el-menu-item index="/dataOverview">
              <el-icon><icon-menu /></el-icon>
              <template #title>数据概览</template>
            </el-menu-item>
            <el-menu-item index="/CandidateManagement">
              <el-icon><icon-menu /></el-icon>
              <template #title>候选人管理</template>
            </el-menu-item>
            <el-sub-menu index="">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>题库管理</span>
              </template>
              <el-menu-item index="/examination/classify">题目分类管理</el-menu-item>
              <el-menu-item index="/examination/gather">题目集管理</el-menu-item>
              <el-menu-item index="/examination/subject">题目管理</el-menu-item>
            </el-sub-menu>
            <el-menu-item index="/interviewRecord">
              <el-icon><icon-menu /></el-icon>
              <template #title>面试记录</template>
            </el-menu-item>
            <el-menu-item index="/interviewArrange">
              <el-icon>
                <document />
              </el-icon>
              <template #title>面试安排</template>
            </el-menu-item>
            <el-menu-item index="/positionManagement">
              <el-icon>
                <setting />
              </el-icon>
              <template #title>职位管理</template>
            </el-menu-item>
            <el-menu-item index="/interviewerManagement">
              <el-icon>
                <setting />
              </el-icon>
              <template #title>面试官管理</template>
            </el-menu-item>
            <el-menu-item index="/systemSetting">
              <el-icon>
                <setting />
              </el-icon>
              <template #title>系统设置</template>
            </el-menu-item>
          </el-menu></el-aside
        >

        <el-container>
          <el-header>
            <!-- 搜索框 -->
            <!-- <div class="searchBox">
              <el-icon><Search /></el-icon>
              <el-input v-model="input" style="width: 260px" placeholder="Please input" /></div
          >-->
            <div class="userInfo">
              <div class="avatar">张</div>
              <div class="Info">
                <div class="userName">张经理</div>
                <div class="permission">管理员</div>
              </div>
            </div>
          </el-header>

          <el-main>
            <RouterView></RouterView>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { ref } from 'vue'
import { Document, Menu as IconMenu, Location, Setting } from '@element-plus/icons-vue'
const input = ref('')
const isCollapse = ref(true)
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>
<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
/* 搜索框样式 */
/* .el-header {

  height: 60px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  align-items: center;
  搜索框
  .searchBox {
    width: 300px;
    height: 35px;
    background-color: #f8f9fa;
    padding: 10px 0px 0px 10px;
    box-sizing: border-box;
    border-radius: 22px;
    display: flex;
    align-items: center;
    padding-top: 5px;
    .el-input {
      height: 30px;
      border: none;
    }
    .el-input__wrapper {
      border: none !important; /* 确保移除边框
      padding: 0;
      background-color: #f8f9fa;
      box-shadow: none;
      .is-focus {
        box-shadow: none;
      }
    }
  }
} */
.el-header {
  height: 60px;
  background-color: #fff;
  display: flex;
  justify-content: end;
  padding: 0 20px;
  box-sizing: border-box;
  align-items: center;
  .userInfo {
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    .avatar {
      width: 35px;
      height: 35px;
      line-height: 35px;
      border-radius: 50%;
      background-color: #5dade2;
      text-align: center;
      color: #fff;
      font-size: 14px;
    }
    .Info {
      .userName {
        font-size: 14px;
        margin-bottom: 2px;
      }
      .permission {
        font-size: 12px;
        color: #6c757d;
      }
    }
  }
}
.el-main {
  padding: 0;
}
</style>
